<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let num = 0;

      let n = 0; //计数当前已经数过了几个数
      while (num <= 10) {
        // 控制最大间隔数
        if (n >= 3) {
          console.log(num);
          n = 0; //重置计算为0
        }
        n++;
        num++;
      }
    </script>
  </body>
</html>
